package time;

import java.time.LocalDate;

/**
 * 日期相关测试
 */
public class LocalDateTest {
    public static void main(String[] args) {
        now();
        customDate();
        dateInfo();
    }

    private static void dateInfo() {
        LocalDate now = LocalDate.now();
        System.out.println("now.getYear() = " + now.getYear());
        System.out.println("now.getMonth() = " + now.getMonth());
        System.out.println("now.getMonthValue() = " + now.getMonthValue());
        System.out.println("now.getDayOfMonth() = " + now.getDayOfMonth());
    }

    private static void customDate() {
        LocalDate date = LocalDate.of(2020, 2, 13);
        System.out.println("date = " + date);
    }

    private static void now() {
        LocalDate now = LocalDate.now();
        System.out.println("now = " + now);
    }
}
